In this video we are going to create an equal weighted stock index containing our six stocks our constituents
and creating an equal weighted index means that at each single point in time we have invested the same
dollar amount into all constituents.
In our example with six stocks one sixth of our investment is invested in each stock and therefore the
performance or the return of our index for each period should be the equal weighted the return of the
six constituents.
So we still have imparted the stocks data frame and the normalized data frame and now in a very next
step we are calculating the simple returns for stocks by using here.
The percentage change method and we are actually saving the returns data frame and the variable rate.
So let's do this.
Let's have a look.
So these are actually the daily simple returns for our stocks.
And as I said to the Simple Return of the equal weighted index is uh simply the equal weighted average
of the returns of the constituents here.
And therefore we can create a new column called mean return.
And uh here for each timestamp of each row we are actually calculating the mean of the returns of the
constituents.
And of course we can do the service of the mean method and passing one to the access parameter and say
OK so here's on the right hand side.
Um.
The mean returns.
And by convention we already know that our equal weighted index should have the value one hundred at
the very first day here at the thirty first of December 2000 and 13 and therefore we can already create
a column for our normal data frame called Equal Weighted Index and in a first step we assign 100 to
each timestamp so let's do this.
So here we are from the right hand side our equal weighted index with uh 100 at the beginning and we
already have everything in place to calculate.
Also the following prices.
So we have for the starting price of 100 and we have the simple returns of our equal weighted index.
And if you want to calculate uh the index price um on the second timestamp here on the second of January
then we simply have to multiply 100 with the investment multiple which is here in this case the one
plus the return.
So the next step is actually to convert all the returns here into the investment multiply by adding
1.
Let's do this here.
So these are the multiple births.
And if you want to calculate the price here at the second timestamp we simply have to multiply one hundred
and O point nine nine four.
So this would be the price on the second timestamp.
And for all of the other timestamps we actually have to multiply the initial value of 100 with the accumulated
investment multiple.
And we can actually calculate the cumulative investment multiple by actually multiplying the single
investment multiple.
So for example on the third timestamp the cumulative investment multiple is uh 0 point 9 9 4 times 0
point 9 9 9 so that would be the cumulative investment multiple for the third timestamp and uh for the
fourth timestamp consequently we would have to multiply the first three investment multiples.
Cumulatively.
And so on.
And we can actually calculate all cumulative investment my words with the come proud method.
So cumulative product
so these are here the cumulative products.
And for example if you want to calculate uh the price of our index at the 9th of January 2014 we have
to multiply the cumulative product so point nine eight nine by the initial price of one hundred and
so on.
This is now our very last step so we calculate and multiply the cumulative investment manager built
by the initial value of one hundred or the initial price.
And now we have actually the prices of our equal weighted index.
So starting at the second time with ninety nine point four 0 0 right and now what we have to do we have
to simply replace here the value starting from the second of January by these values here.
So let's do this.
So this is nothing nothing new here.
And finally now we have you on the right hand side of our neon data frame.
Our equally weighted index and now we can also plotted the constituents here and our equal weighted
index so let's do this here and let's have a look so here we can see in dark blue our equal weighted
index.
And we can also only plot.
The Equal Weighted Index with the Amazon stock
and we can already see here that the equal weighted index is less correlated to the Amazon stock.
Then the price weighted index because the weight of the Amazon stock here in the equal weighted index
is much smaller.
And for comparison purposes we can also plot to the equal weighted index and the price weighted index
so here we have in blue the price weighted index and in green the equal weighted index.
And it seems like that over the whole period the price weighted index showed a higher return.
And this is simply the case because the Amazon stock soars.
For all the constituents the highest return and the weight of Amazon and the price weighted indexes
are actually much higher than in the equal weighted index.
And for the sake of completeness we can also create a data frame with the rates over time so we create
a copy of our stocks data frame and call it the way it's equally weighted index and then for each and
every value we assign actually the value of one sixth.
So let's have a look.
So this is actually no surprise and it's more or less a no brainer.
And we can also plot and visualize the rates over time.
So here we have add to the value of 1 6 actually all the stocks that our constituents.
And the weights actually totally stable over time.
At 1 6.
So this is the equal weighted index and one advantage is that it shows the best possible diversification
and there's actually no concentration of a single stock on the other inside smaller stocks in terms
of market cap favored and have higher rates than they should have according to the market cap and a
smaller stocks.
In many cases they're riskier than larger stocks an equal weighted index has typically higher risk.
And finally as another disadvantage.
So at each point in time you would have to rebalance the stocks to equal weight by selling winners and
buying losers.
And that would create a substantial transaction costs.
So also here we have uh disadvantages and advantages and in the next video we will create a value weighted
index.
So I hope to see you there by.